<%--
  Created by IntelliJ IDEA.
  User: DELL
  Date: 2019/5/8
  Time: 12:54
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="javabean.Userbean" %>
<jsp:useBean id="u1" class="javabean.Userbean" scope="session"/>
<html>
<head>
    <meta charset="UTF-8">
    <title>登录</title>
    <style type="text/css">
        body
        {
            text-align: center;
            background-image: url(1.jpg);
            background-repeat: no-repeat;
            background-size: 1550px 800px;
            background-attachment: fixed;
        }
        .div
        {
            border: 1px solid grey;
            border-radius: 10px 10px 10px 10px;
            width: 300px;
            height: 230px;
            margin: 0 auto;
            align-self: center;
            background-color:white;
            opacity: 0.7;
        }
        .div1
        {
            padding-right:15px;
            padding-top:20px;
        }
        .div2
        {
            padding-right:0px;
            padding-top:20px;
        }
        .div3
        {
            padding-top:5px;
        }
        .div4
        {
            text-align: center;
            font-size: 10px;
        }
        a
        {
            font-size: 10px;
        }
        .sub
        {
            width: 200px;
            color: white;
            background-color:orange;
            border: none;
        }
        #div
        {
            height: 100px;
        }
        .i1
        {
            padding: 2px 0 5px 6px;
        }
        .d1
        {
            padding-top: 5px;
            height: 15px;
            font-size: 10px;
            color: red;
        }
        .d2
        {
            padding-top: 5px;
        }
    </style>
</head>
<body>
<%
    String error = "";
    String username=null;
    if(session.getAttribute("users")!=null)
    {
        u1 = (Userbean)session.getAttribute("users");
        username = u1.getUsername();
    }
    if(username!=null&&(!u1.login()))
    {
        error = "用户名不存在或密码错误!";
    }
%>
<div id="div"></div>
<h3>用户登录</h3>
<div class="div">
    <form action="/localLogin" method="post">
        <div class="div1">
            用户名:<input type="text" name="username" class="i1" required/>
        </div>
        <div class="div2">
            密码:<input type="password" name="password" class="i1" required/>
        </div>
        <div class="d1"><%=error%></div>
        <div class="div3">
            <input type="submit" name="login" value="登录" class="sub">
        </div>
        <div class="d2"><a href="/register.jsp">立即注册</a></div>
        <div class="div4">
            <p>其他登录方式</p>
            <a href="/login/dgut"><img src="dgut.jpg" width="30" height="30" /></a>
        </div>
    </form>
</div>

</body>
</html>
